import request from '../../utils/request';
import {download} from '../../utils/commons'
const R=require("ramda");
/**
 * 查询费用信息
 * @param lesseesCode
 * @param beginTime
 * @param endTime
 * @param page
 */
export async function getOrderChargeList({beginTime, endTime,status, page}) {
    return request(apiPath.imagent + "/api/report/orderCharge",
        {
            method: 'get',
            data: {beginTime: beginTime, endTime: endTime,status:status, page: page.page, size: page.size}
        });
}


/**
 * 导出费用信息
 * @param lesseesCode
 * @param beginTime
 * @param endTime
 */
export async function exportOrderChargeList({beginTime, endTime,status}) {
    let url =  apiPath.imagent + "/api/report/orderCharge/export";
    let data={};
    beginTime=R.isNil(beginTime)?'':beginTime;
    endTime=R.isNil(endTime)?'':endTime;
    status=R.isNil(status)?'':status;
    data={beginDate: beginTime, endDate: endTime,status:status, filename: '费用明细表'};
    download(url, data);
}



